package com.zhentao.day03.pm;

import java.util.Scanner;

public class StringTest {

  public static void main(String[] args) {

    Scanner scn = new Scanner(System.in);
    System.out.println("请输入航班号,起始地,目的地");
    // 实现一行录入,实现对对象的赋值  以, 为分割
    String inputStr = scn.next() ;

    System.out.println(inputStr);
    // 字符串的分割
    String[] split = inputStr.split(",");

    Flage flage = new Flage(split[0],split[1],split[2]);

    System.out.println("flage = " + flage);
    System.out.println("flage = " + flage.toString());

  }

}

class Flage {
  private String hanBanHao ;
  private String chuFaDiDian ;
  private String zhongDan;

  public Flage(String hanBanHao, String chuFaDiDian, String zhongDan) {
    this.hanBanHao =  hanBanHao;
    this.chuFaDiDian = chuFaDiDian ;
    this.zhongDan = zhongDan ;
  }

  @Override
  public String toString() {
    return this.hanBanHao + "\t" + this.chuFaDiDian + "\t" + this.zhongDan + "\n";
  }
}
